Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Creating and Editing Trigrids

QuickDraw 3D provides routines that you can use to create and manipulate trigrids. See "Trigrids" for the definition of a trigrid.

Q3TriGrid_New

You can use the Q3TriGrid_New function to create a new trigrid.

TQ3GeometryObject Q3TriGrid_New (
                     const TQ3TriGridData *triGridData);
triGridData
A pointer to a TQ3TriGridData structure.

DESCRIPTION

The Q3TriGrid_New function returns, as its function result, a new trigrid having the vertices and attributes specified by the triGridData parameter. If a new trigrid could not be created, Q3TriGrid_New returns the value NULL .

Q3TriGrid_Submit

You can use the Q3TriGrid_Submit function to submit an immediate trigrid for drawing, picking, bounding, or writing.

TQ3Status Q3TriGrid_Submit (
                     const TQ3TriGridData *triGridData,
                     TQ3ViewObject view);
triGridData
A pointer to a TQ3TriGridData structure.
view
A view.

DESCRIPTION

The Q3TriGrid_Submit function submits for drawing, picking, bounding, or writing the immediate trigrid whose shape and attribute set are specified by the triGridData parameter. The trigrid is drawn, picked, bounded, or written according to the view characteristics specified in the view parameter.

SPECIAL CONSIDERATIONS

You should call this function only in a submitting loop.

Q3TriGrid_GetData

You can use the Q3TriGrid_GetData function to get the data that defines a trigrid and its attributes.

TQ3Status Q3TriGrid_GetData (
                     TQ3GeometryObject trigrid,
                     TQ3TriGridData *triGridData);
trigrid
A trigrid.
triGridData
On exit, a pointer to a TQ3TriGridData structure that contains information about the trigrid specified by the trigrid parameter.

DESCRIPTION

The Q3TriGrid_GetData function returns, through the triGridData parameter, information about the trigrid specified by the trigrid parameter. QuickDraw 3D allocates memory for the TQ3TriGridData structure internally; you must call Q3TriGrid_EmptyData to dispose of that memory.

Q3TriGrid_SetData

You can use the Q3TriGrid_SetData function to set the data that defines a trigrid and its attributes.

TQ3Status Q3TriGrid_SetData (
                     TQ3GeometryObject trigrid,
                     const TQ3TriGridData *triGridData);
trigrid
A trigrid.
triGridData
A pointer to a TQ3TriGridData structure.

DESCRIPTION

The Q3TriGrid_SetData function sets the data associated with the trigrid specified by the trigrid parameter to the data specified by the triGridData parameter.

Q3TriGrid_EmptyData

You can use the Q3TriGrid_EmptyData function to release the memory occupied by the data structure returned by a previous call to Q3TriGrid_GetData .

TQ3Status Q3TriGrid_EmptyData (TQ3TriGridData *triGridData);
triGridData
A pointer to a TQ3TriGridData structure.

DESCRIPTION

The Q3TriGrid_EmptyData function releases the memory occupied by the TQ3TriGridData structure pointed to by the triGridData parameter; that memory was allocated by a previous call to Q3TriGrid_GetData .

Q3TriGrid_GetVertexPosition

You can use the Q3TriGrid_GetVertexPosition function to get the position of a vertex of a trigrid.

TQ3Status Q3TriGrid_GetVertexPosition (
                     TQ3GeometryObject triGrid,
                     unsigned long rowIndex,
                     unsigned long columnIndex,
                     TQ3Point3D *position);
triGrid
A trigrid.
rowIndex
A row index into the vertices array of the specified trigrid.
columnIndex
A column index into the vertices array of the specified trigrid.
position
On exit, the position of the specified vertex.

DESCRIPTION

The Q3TriGrid_GetVertexPosition function returns, in the position parameter, the position of the vertex having row and column indices rowIndex and columnIndex in the vertices array of the trigrid specified by the triGrid parameter.

Q3TriGrid_SetVertexPosition

You can use the Q3TriGrid_SetVertexPosition function to set the position of a vertex of a trigrid.

TQ3Status Q3TriGrid_SetVertexPosition (
                     TQ3GeometryObject triGrid,
                     unsigned long rowIndex,
                     unsigned long columnIndex,
                     const TQ3Point3D *position);
triGrid
A trigrid.
rowIndex
A row index into the vertices array of the specified trigrid.
columnIndex
A column index into the vertices array of the specified trigrid.
position
The desired position of the specified vertex.

DESCRIPTION

The Q3TriGrid_SetVertexPosition function sets the position of the vertex having row and column indices rowIndex and columnIndex in the vertices array of the trigrid specified by the triGrid parameter to that specified in the position parameter.

Q3TriGrid_GetVertexAttributeSet

You can use the Q3TriGrid_GetVertexAttributeSet function to get the attribute set of a vertex of a trigrid.

TQ3Status Q3TriGrid_GetVertexAttributeSet (
                     TQ3GeometryObject triGrid,
                     unsigned long rowIndex,
                     unsigned long columnIndex,
                     TQ3AttributeSet *attributeSet);
triGrid
A trigrid.
rowIndex
A row index into the vertices array of the specified trigrid.
columnIndex
A column index into the vertices array of the specified trigrid.
attributeSet
On exit, a pointer to a vertex attribute set for the specified vertex.

DESCRIPTION

The Q3TriGrid_GetVertexAttributeSet function returns, in the attributeSet parameter, the set of attributes for the vertex having row and column indices rowIndex and columnIndex in the vertices array of the trigrid specified by the triGrid parameter. The reference count of the set is incremented.

Q3TriGrid_SetVertexAttributeSet

You can use the Q3TriGrid_SetVertexAttributeSet function to set the attribute set of a vertex of a trigrid.

TQ3Status Q3TriGrid_SetVertexAttributeSet (
                     TQ3GeometryObject triGrid,
                     unsigned long rowIndex,
                     unsigned long columnIndex,
                     TQ3AttributeSet attributeSet);
triGrid
A trigrid.
rowIndex
A row index into the vertices array of the specified trigrid.
columnIndex
A column index into the vertices array of the specified trigrid.
attributeSet
The desired set of attributes for the specified vertex.

DESCRIPTION

The Q3TriGrid_SetVertexAttributeSet function sets the attribute set of the vertex having row and column indices rowIndex and columnIndex in the vertices array of the trigrid specified by the triGrid parameter to the set specified in the attributeSet parameter.

Q3TriGrid_GetFacetAttributeSet

You can use the Q3TriGrid_GetFacetAttributeSet function to get the attribute set of a facet of a trigrid.

TQ3Status Q3TriGrid_GetFacetAttributeSet (
                     TQ3GeometryObject triGrid,
                     unsigned long faceIndex,
                     TQ3AttributeSet *facetAttributeSet);
triGrid
A trigrid.
faceIndex
An index into the array of facets for the specified trigrid.
facetAttributeSet
On exit, a pointer to an attribute set for the specified facet.

DESCRIPTION

The Q3TriGrid_GetFacetAttributeSet function returns, in the facetAttributeSet parameter, the set of attributes for the facet having the index faceIndex of the trigrid specified by the triGrid parameter. The reference count of the set is incremented.

Q3TriGrid_SetFacetAttributeSet

You can use the Q3TriGrid_SetFacetAttributeSet function to set the attribute set of a facet of a trigrid.

TQ3Status Q3TriGrid_SetFacetAttributeSet (
                     TQ3GeometryObject triGrid,
                     unsigned long faceIndex,
                     TQ3AttributeSet facetAttributeSet);
triGrid
A trigrid.
faceIndex
An index into the array of facets for the specified trigrid.
facetAttributeSet
The desired set of attributes for the specified facet.

DESCRIPTION

The Q3TriGrid_SetFacetAttributeSet function sets the attribute set of the facet having index faceIndex of the trigrid specified by the triGrid parameter to the set specified by the facetAttributeSet parameter.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |